import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;


public class Main {

    public static Shell shell;
    public static void main(String[] args) {
        Display display = new Display();
        shell = new Shell(display, SWT.MIN|SWT.MAX|SWT.CLOSE|SWT.RESIZE);
        shell.setLayout(new FillLayout());
        int width = display.getClientArea().width/2;
        int height = display.getClientArea().height*2/3;
        shell.setLocation(-10,display.getClientArea().height-height+10);
        shell.setSize(width,height);
        shell.setText("Android辅助开发工具");
        Browser browser = new Browser(shell, SWT.FILL_WINDING);
        new BrowserHelper(browser,"exec");
        //设置图标
        Image image = new Image(shell.getDisplay(), BrowserHelper.resRoot+"icon.ico");
        shell.setImage(image);
        shell.layout();
        shell.open();

        while (!shell.isDisposed()){
            if(!display.readAndDispatch()){
                display.sleep();
            }
        }
        display.dispose();
    }
}
